package model

import "time"

type AdminMemberLog struct {
	Id              uint64       `gorm:"column:id;primaryKey;autoIncrement:false" json:"id"`
	AuthKey         string       `gorm:"column:auth_key;type:varchar(64);not null;default:''" json:"auth_key,omitempty"`
	Url             string       `gorm:"column:url;type:varchar(200);not null;default:''" json:"url,omitempty"`
	Method          string       `gorm:"column:method;type:varchar(8);not null;default:''" json:"method,omitempty"`
	MemberId        uint64       `gorm:"column:member_id;not null;default:0;index" json:"member_id,omitempty"`
	DataId          string       `gorm:"column:data_id;type:varchar(100);not null;default:'';index" json:"data_id,omitempty"`
	Ip              string       `gorm:"column:ip;type:varchar(64);not null;default:'';index" json:"ip,omitempty"`
	IpRegion        string       `gorm:"column:ip_region;type:varchar(64);not null;default:''" json:"ip_region,omitempty"`
	IpProvince      string       `gorm:"column:ip_province;type:varchar(64);not null;default:''" json:"ip_province,omitempty"`
	Platform        string       `gorm:"column:platform;type:varchar(64);not null;default:''" json:"platform,omitempty"`
	PlatformVersion string       `gorm:"column:platform_version;type:varchar(64);not null;default:''" json:"platform_version,omitempty"`
	Browser         string       `gorm:"column:browser;type:varchar(64);not null;default:''" json:"browser,omitempty"`
	BrowserVersion  string       `gorm:"column:browser_version;type:varchar(64);not null;default:''" json:"browser_version,omitempty"`
	CreatedAt       *time.Time   `gorm:"column:created_at;autoCreateTime" json:"created_at,omitempty"`
	Latency         uint64       `gorm:"column:latency;not null;default:0" json:"latency,omitempty"`
	Member          *AdminMember `gorm:"hasone:admin_member;foreignKey:member_id;references:id" json:"-"`
}
